// @ts-ignore
import request from '@/api/request.js'

export async function login(username: string, password: string) {
  return await request.post('/user/login', { username, password })
}

export async function register(username: string, password: string,email:string,phone:string,nickname:string) {

  return await request.post('/user/regist', { username, password,email,phone,nickname})
}

export async function getUserInfo(userId: number) {
  return await request.get(`/user/${userId}`)
}

export async function getUserOrders() {
  return await request.get('/user/orders')
}

export async function getQuan(page?: any) {
  return await request.post('/bag/my/quan', page)
}

export async function checkin() {
  return await request.post('/campaign/checkin')
}

export async function isCheckin() {
  return await request.get('/campaign/is/checkin')
}

export async function getKaihu() {
  return await request.post('/order/open')
}
// 检查用户是否已开户
export async function checkUserOpenAccount() {
  return await request.get('/order/judgeOpen')
}